package com.example.arguslogexample.service.impl;

import com.example.arguslogexample.entity.User;
import com.example.arguslogexample.service.UserService;
import com.example.arguslogexample.utils.ObjectUtil;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @author chenenwei
 */
@Service
public class UserServiceImpl implements UserService {

    @Override
    public User getUserById(Long id) {
        User user  = new User(id, "张三", 18);
        return ObjectUtil.isEmpty(user) ? null : user ;
    }

    @Override
    public List<User> listUsers(Map<String, Object> param) {
        return Arrays.asList(new User(1L, "张三", 18),
                new User(2L, "李四", 19),
                new User(3L, "王五", 28));
    }
}
